﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MetaDemo.Tabs
{
    public partial class Todo29Tab : UserControl
    {

        public static TabPage Get(ToolStrip ts)
        {
            // Create a tab page in which to display the information above.
            var page = GetTabPage();
            page.Controls.Add(new Todo29Tab(ts));

            return page;
        }

        public static TabPage GetTabPage()
        {
            var page = new TabPage();

            page.Location = new System.Drawing.Point(4, 22);
            page.Name = "tabTodo29";
            page.Padding = new System.Windows.Forms.Padding(3);
            page.Size = new System.Drawing.Size(428, 391);
            page.Text = "Todo29";
            //            page.TabIndex = 0;
            page.UseVisualStyleBackColor = true;
            
            return page;
        }

        
        ToolStrip toolStrip;

        public Todo29Tab(ToolStrip ts)
        {
            InitializeComponent();

            toolStrip = ts;
        }

        private void btnAddMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem m = new ToolStripMenuItem("Raise!");
            m.Click += new EventHandler(m_Click);
            
            this.toolStrip.Items.Add(m);
        }

        void m_Click(object sender, EventArgs e)
        {
            MessageBox.Show("It works!");
        }
    }
}
